package com.jiang.jetpackdemo.fragment

import android.content.Intent
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

import com.jiang.jetpackdemo.R
import com.jiang.jetpackdemo.activity.FavoritesPageActivity
import com.jiang.jetpackdemo.activity.SettingActivity
import kotlinx.android.synthetic.main.mine_fragment.*

class MineFragment : Fragment() {

    companion object {
        fun newInstance() = MineFragment()
    }

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return inflater.inflate(R.layout.mine_fragment, container, false)
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
//        viewModel = ViewModelProviders.of(this).get(MineViewModel::class.java)
        btn_setting.setOnClickListener {
            startActivity(Intent(context, SettingActivity::class.java))
        }
        btn_collection.setOnClickListener { startActivity(Intent(context, FavoritesPageActivity::class.java))}
    }

}
